package com.marswin89.marsdaemon.demo;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

import java.util.Timer;
import java.util.TimerTask;

/**
 * This Service is Persistent Service. Do some what you want to do here.<br/>
 * <p/>
 * Created by Mars on 12/24/15.
 */
public class Service1 extends Service {

    @Override
    public void onCreate() {
        super.onCreate();
        FileUtil.getInstance().writeLog("Service1_onCreate\n\n\n");
        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                FileUtil.getInstance().writeLog("TimerTask\n\n\n");
                LocationUtil.getLocation(getApplicationContext());
            }
        }, 60 * 1000, 2 * 60 * 1000);
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}
